
public class Tasks implements Comparable<Tasks>{
	private Integer ctime;
	private Integer period;
	private String name;
	public Tasks(String name, int ctime, int period){
		this.period=period;
		this.ctime=ctime;
		this.name=name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getCtime() {
		return ctime;
	}

	public void setCtime(int ctime) {
		this.ctime = ctime;
	}

	public int getPeriod() {
		return period;
	}

	public void setPeriod(int period) {
		this.period = period;
	}

	@Override
	public int compareTo(Tasks t) {
		// TODO Auto-generated method stub
		int porownane = period.compareTo(t.period);
		if(porownane == 0){
			return ctime.compareTo(t.ctime);
		}else{
			return porownane;
		}
	
	}
	
	@Override
    public String toString() {
        return ctime + " " + period;
    }


	
}
